#include "WidgetVariant.h"

WidgetVariant::WidgetVariant(QWidget *parent) :
    QWidget(parent)
{
}

WidgetVariant::~WidgetVariant()
{
}
    

void WidgetVariant::refreshByProperty(EItemMetaPropertyPtr p)
{
    m_property = p;
}

void WidgetVariant::buildConnect()
{
}

void WidgetVariant::clearConnect()
{
}

void WidgetVariant::performFilt()
{

}

void WidgetVariant::addFiltChildWidget(WidgetVariant* childPtr)
{
    m_filtChildWdgetList.push_back(childPtr);
}
    
void WidgetVariant::addFiltStr(const QString& filtStr)
{
    m_filtStr.push_back(filtStr);
}

void WidgetVariant::filtWidget(const QString& filtStr)
{
    for(int i = 0 ; i < m_filtChildWdgetList.size(); i++)
    {
        WidgetVariant* wv = m_filtChildWdgetList[i];
        if(wv->m_filtStr.contains(filtStr))
        {
            wv->setHidden(false);
        }
        else
        {
            wv->setHidden(true);
        }
    }
}
    
EItemMetaPropertyPtr WidgetVariant::getVariantProperty()
{
    return m_property;
}
    
